package com.whatisjee.ssf.misc;

import java.io.Serializable;

public class Page implements Serializable {
	private static final long serialVersionUID = -4400881387321339466L;

	public static enum Order {ASC, DESC};
	public static final Order ORDER_ASC = Order.ASC;
	public static final Order ORDER_DESC = Order.DESC;
	public static final Page MAX_PAGE = new Page(0, Integer.MAX_VALUE);
	
	private int firstRow;	
	private int rows;	
	private String orderBy;	
	private Order order = ORDER_ASC;
	
	public Page() { }
	
	public Page(int firstRow, int rows) {
		this.firstRow = firstRow;
		this.rows = rows;
	}

	public Page(int firstRow, int rows, String orderBy, Order order) {
		this.firstRow = firstRow;
		this.rows = rows;
		this.orderBy = orderBy;
		this.order = order;
	}

	public int getFirstRow() {
		return firstRow;
	}
	
	public void setFirstRow(int firstRow) {
		this.firstRow = firstRow;
	}
	
	public int getRows() {
		return rows;
	}
	
	public void setRows(int rows) {
		this.rows = rows;
	}
	
	public String getOrderBy() {
		return orderBy;
	}
	
	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}
	
	public Order getOrder() {
		return order;
	}
	
	public void setOrder(Order order) {
		this.order = order;
	}
}
